package com.jlee.android.pimclient;

import android.net.Uri;
import android.provider.CallLog;
import android.provider.Contacts;

public class PIMClientConstant {
	public static final String TAG = "PIMClient";

	public static final String XML_PATH = "pim.xml";
	
	/**
	 * Defined for the preference
	 */
	public static final String PREFS_NAME = "PIMClientPref";

	// key for the first start check
	public static final String PREFS_KEY_FIRSTSTART = "firststart";
	public static final String PREFS_KEY_ASSIGNED = "assigned";

	// keys for the contact setting
	public static final String PREFS_KEY_CONTACT_COMPANYNAME = "contact_companyname";
	public static final String PREFS_KEY_CONTACT_JOBTITLE = "contact_jobtitle";
	
	public static final String PREFS_KEY_CONTACT_NAME = "contact_name";
	public static final String PREFS_KEY_CONTACT_DISPLAYNAME = "contact_displayname";
	public static final String PREFS_KEY_CONTACT_NOTES = "contact_notes";
	public static final String PREFS_KEY_CONTACT_IM = "im";
	
	public static final String PREFS_KEY_CONTACT_PERSONALMAIL = "personalmail";
	public static final String PREFS_KEY_CONTACT_BUSINESSMAIL = "businessmail";
	
	public static final String PREFS_KEY_CONTACT_MOBILE = "mobile";
	public static final String PREFS_KEY_CONTACT_HOMEPHONE = "homephone";
	public static final String PREFS_KEY_CONTACT_WORKPHONE = "workphone";
	public static final String PREFS_KEY_CONTACT_HOMEFAX = "homefax";
	public static final String PREFS_KEY_CONTACT_WORKFAX = "workfax";
	
	public static final String PREFS_KEY_CONTACT_PICTURE = "picture";
	
	// keys for the calllog setting
	public static final String PREFS_KEY_CALLLOG_NAME = "calllog_name";
	public static final String PREFS_KEY_CALLLOG_NUMBER = "calllog_number";
	public static final String PREFS_KEY_CALLLOG_TYPE = "calllog_type";
	public static final String PREFS_KEY_CALLLOG_DURATION = "calllog_duration";
	
	// keys for the SMS setting
	public static final String PREFS_KEY_SMS_DATE = "sms_date";
	public static final String PREFS_KEY_SMS_MESSAGE = "sms_message";
	public static final String PREFS_KEY_SMS_NUMBER = "sms_number";
	public static final String PREFS_KEY_SMS_TYPE = "sms_type";
	
	// keys for the Calendar setting
	public static final String PREFS_KEY_CALENDAR_TITLE = "calendar_title";
	public static final String PREFS_KEY_CALENDAR_DESCRIPTION = "calendar_description";
	public static final String PREFS_KEY_CALENDAR_LOCATION = "calendar_location";
	public static final String PREFS_KEY_CALENDAR_STARTTIME = "calendar_starttime";
	public static final String PREFS_KEY_CALENDAR_ENDTIME = "calendar_endtime";
	
	/**
	 * Defined for the Calendar provider.
	 * 
	 * FIXME: Since the Calendar provider doesn't exposed in Android 1.0 SDK,
	 * 			use hard-code string instead.
	 */
	public static final Uri CALENDAR_CONTENT_URI = Uri.parse("content://calendar/events");
	public static final String[] CALENDAR_PROJECTION = {
		"title",
		"description",
		"eventLocation",
		"dtstart",
		"dtend"
	};
	public static final int CALENDAR_TITLE_INDEX = 0;
	public static final int CALENDAR_DESCRIPTIOOIN_INDEX = 1;
	public static final int CALENDAR_LOCATION_INDEX = 2;
	public static final int CALENDAR_STARTTIME_INDEX = 3;
	public static final int CALENDAR_ENDTIME_INDEX = 4;
	
	/**
	 * Defined for the SMS provider.
	 * 
	 * FIXME: Since the SMS provider doesn't exposed in Android 1.0 SDK,
	 * 			use hard-code string instead.
	 * TODO: Find a way to get the non-contact number.
	 */
	public static final Uri SMS_CONTENT_URI = Uri.parse("content://sms");
    public static final int SMS_TYPE_INBOX  = 1;
    public static final int SMS_TYPE_SENT   = 2;
	
    public static final String[] SMS_PROJECTION = {
		"date",
		"body",
		"type",
		"address"
	};
    public static final int SMS_DATE_INDEX = 0;
    public static final int SMS_BODY_INDEX = 1;
    public static final int SMS_TYPE_INDEX = 2;
    public static final int SMS_ADDRESS_INDEX = 3;
	
	/**
	 * Defined for the CallLog provider
	 */
	public static final String[] CALLLOG_PROJECTION = {
		CallLog.Calls.CACHED_NAME,
		CallLog.Calls.NUMBER,
		CallLog.Calls.TYPE,
		CallLog.Calls.DURATION
	};
	public static final int CALLLOG_NAME_INDEX = 0;
	public static final int CALLLOG_NUMBER_INDEX = 1;
	public static final int CALLLOG_TYPE_INDEX = 2;
	public static final int CALLLOG_DURATION_INDEX = 3;
	
	/**
	 * Defined for the Contact Organization provider
	 */
	public static final String[] CONTACT_ORGANIZATION_PROJECTION = {
		Contacts.Organizations.PERSON_ID,
		Contacts.Organizations.COMPANY,
		Contacts.Organizations.TITLE
	};
	public static final int CONTACT_ORGANIZATION_PERSONID_INDEX = 0;
	public static final int CONTACT_ORGANIZATION_COMPANYNAME_INDEX = 1;
	public static final int CONTACT_ORGANIZATION_JOBTITLE_INDEX = 2;

	/**
	 * Defined for the Contact People provider
	 */
	public static final String[] CONTACT_PEOPLE_PROJECTION = {
		Contacts.People._ID,
		Contacts.People.NAME,
		Contacts.People.DISPLAY_NAME,
		Contacts.People.NOTES
	};
	public static final int CONTACT_PEOPLE_ID_INDEX = 0;
	public static final int CONTACT_PEOPLE_NAME_INDEX = 1;
	public static final int CONTACT_PEOPLE_DISPLAYNAME_INDEX = 2;
	public static final int CONTACT_PEOPLE_NOTES_INDEX = 3;

	/**
	 * Defined for the Contact Methods provider
	 */
	public static final String[] CONTACT_METHODS_PROJECTION = {
		Contacts.ContactMethods.PERSON_ID,
		Contacts.ContactMethods.DATA,
		Contacts.ContactMethods.TYPE,
		Contacts.ContactMethods.KIND
	};
	public static final int CONTACT_METHODS_PERSONID_INDEX = 0;
	public static final int CONTACT_METHODS_DATA_INDEX = 1;
	public static final int CONTACT_METHODS_TYPE_INDEX = 2;
	public static final int CONTACT_METHODS_KIND_INDEX = 3;
	
	/**
	 * Defined for the Contact Phone provider
	 */
	public static final String[] CONTACT_PHONE_PROJECTION = {
		Contacts.Phones.PERSON_ID,
		Contacts.Phones.TYPE,
		Contacts.Phones.NUMBER
	};
	public static final int CONTACT_PHONE_PERSONID_INDEX = 0;
	public static final int CONTACT_PHONE_TYPE_INDEX = 1;
	public static final int CONTACT_PHONE_NUMBER_INDEX = 2;
	
	/**
	 * Defined for the Contact Photos provider
	 */
	public static final String[] CONTACT_PHOTOS_PROJECTION = {
		Contacts.Photos.PERSON_ID,
		Contacts.Photos.DATA
	};
	public static final int CONTACT_PHOTOS_PERSONID_INDEX = 0;
	public static final int CONTACT_PHOTOS_DATA_INDEX = 1;
}
